package com.Nuyoah.demo01;

import com.Nuyoah.demo01.common.JsonResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;

@RequestMapping("/test")
public class testLogController {
    private final static Logger logger = LoggerFactory.getLogger(testLogController.class);

    @RequestMapping("/log")

    public JsonResult<String> testLog() {
        logger.debug("=====测试日志debug级别打印====");
        logger.info("======测试日志info级别打印=====");
        logger.error("=====测试日志error级别打印====");
        logger.warn("======测试日志warn级别打印=====");

        // 可以使用占位符打印出一些参数信息
        String str1 = "blog.itcodai.com";
        String str2 = "blog.csdn.net/eson_15";
        logger.info("======测试：{}", str1, str2);

        return new JsonResult<>("success");
    }

}
